﻿'1071029 Nguyen Huu Hung
'1071031 Duong Vi Huy
'1071064 Tran Cong Thang
Public Class MainForm
    Public current_user As User
    Dim mainStatusBar As New StatusBar()
    Dim statusPanel As New StatusBarPanel()
    Dim datetimePanel As New StatusBarPanel()
    Private Sub ThoátToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ThoátToolStripMenuItem.Click
        Application.Exit()
    End Sub

    Private Sub NgânHàngToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles NgânHàngToolStripMenuItem.Click
        TaiKhoanNganHangForm.MdiParent = Me
        TaiKhoanNganHangForm.Show()
    End Sub

    Private Sub ThuChiCốĐịnhToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ThuChiCốĐịnhToolStripMenuItem.Click
        ThuChiCoDinh.MdiParent = Me
        ThuChiCoDinh.Show()
    End Sub

    Private Sub ChiPhíToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs)
        ChiPhiForm.MdiParent = Me
        ChiPhiForm.Show()
    End Sub

    Private Sub ThuNhậpToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs)
        ThuNhapForm.MdiParent = Me
        ThuNhapForm.Show()
    End Sub

    Private Sub NgườiDùngToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles userMenu.Click
        UsersForm.MdiParent = Me
        UsersForm.Show()
    End Sub

    Private Sub NgânHàngToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs)
        NganHangForm.MdiParent = Me
        NganHangForm.Show()
    End Sub

    Private Sub TiềnTiếtKiệmToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TiềnTiếtKiệmToolStripMenuItem.Click
        TietKiemForm.MdiParent = Me
        TietKiemForm.Show()
    End Sub

    Private Sub PhânLoạiThuChiToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles PhânLoạiThuChiToolStripMenuItem.Click
        PhanLoaiThuChi.MdiParent = Me
        PhanLoaiThuChi.Show()
    End Sub

    Private Sub DanhSáchToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs)
        TheTinDungForm.MdiParent = Me
        TheTinDungForm.Show()
    End Sub

    Private Sub ThanhToánToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs)
        ThanhToanTheForm.MdiParent = Me
        ThanhToanTheForm.Show()
    End Sub

    Private Sub NợToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles NợToolStripMenuItem.Click
        QuanLyNoForm.MdiParent = Me
        QuanLyNoForm.Show()
    End Sub

    Private Sub PhiếuThuToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles PhiếuThuToolStripMenuItem.Click
        QuanLyThuForm.MdiParent = Me
        QuanLyThuForm.Show()
    End Sub

    Private Sub PhiếuChiToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles PhiếuChiToolStripMenuItem.Click
        QuanLyChiForm.MdiParent = Me
        QuanLyChiForm.Show()
    End Sub

    Private Sub MainForm_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        If current_user.QuyenHan = 1 Then
            userMenu.Visible = True
        Else
            userMenu.Visible = False
        End If
        CreateDynamicStatusBar()
    End Sub
    Private Sub CreateDynamicStatusBar()
        statusPanel.BorderStyle = StatusBarPanelBorderStyle.Sunken
        statusPanel.Text = "Application started. Welcome to " & current_user.Fullname
        statusPanel.ToolTipText = "Last Activity"
        statusPanel.AutoSize = StatusBarPanelAutoSize.Spring
        mainStatusBar.Panels.Add(statusPanel)
        datetimePanel.BorderStyle = StatusBarPanelBorderStyle.Raised
        datetimePanel.ToolTipText = "DateTime: " + System.DateTime.Today.ToString()
        datetimePanel.Text = System.DateTime.Today.ToLongDateString()
        datetimePanel.AutoSize = StatusBarPanelAutoSize.Contents
        mainStatusBar.Panels.Add(datetimePanel)
        mainStatusBar.ShowPanels = True
        Controls.Add(mainStatusBar)
    End Sub

    Private Sub DanhSáchToolStripMenuItem_Click_1(sender As System.Object, e As System.EventArgs) Handles DanhSáchToolStripMenuItem.Click
        TheTinDungForm.MdiParent = Me
        TheTinDungForm.Show()
    End Sub

    Private Sub ThanhToánToolStripMenuItem_Click_1(sender As System.Object, e As System.EventArgs) Handles ThanhToánToolStripMenuItem.Click
        ThanhToanTheForm.MdiParent = Me
        ThanhToanTheForm.Show()
    End Sub

    Private Sub LogoutToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles LogoutToolStripMenuItem.Click
        Me.current_user = Nothing
        Me.Dispose()
        LoginForm.Show()
    End Sub

    Private Sub SốTiênHiệnTạiToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles SốTiênHiệnTạiToolStripMenuItem.Click
        SoTienHienTaiForm.MdiParent = Me
        SoTienHienTaiForm.Show()
    End Sub

    Private Sub DựTínhTươngLaiToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles DựTínhTươngLaiToolStripMenuItem.Click
        DuTinhTuongLaiForm.MdiParent = Me
        DuTinhTuongLaiForm.Show()
    End Sub

    Private Sub BáoCáoThuThiTheoThángnămToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles BáoCáoThuThiTheoThángnămToolStripMenuItem.Click
        BaoCaoThuChiForm.MdiParent = Me
        BaoCaoThuChiForm.Show()
    End Sub

    Private Sub LịchSửThuChiToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles LịchSửThuChiToolStripMenuItem.Click
        LichSuThuChiForm.MdiParent = Me
        LichSuThuChiForm.Show()
    End Sub

    Private Sub TínhThuếThuNhậpCáNhânToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs) Handles TínhThuếThuNhậpCáNhânToolStripMenuItem1.Click
        ThueThuNhapCaNhanForm.MdiParent = Me
        ThueThuNhapCaNhanForm.Show()
    End Sub
End Class
